package com.peanut.youfupay.service.must;


import com.alibaba.fastjson.JSON;
import com.peanut.youfupay.entity.request.SignContract;
import com.peanut.youfupay.entity.response.ResponseMessage;
import com.peanut.youfupay.entity.response.SignQueryResult;
import com.peanut.youfupay.enums.FunCodeEnum;
import com.peanut.youfupay.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 个体工商业者签约查询
 *
 * @author peanut
 */
@Slf4j
@Service("signContractQueryService")
public class SignContractQueryService extends BaseService {
    /**
     * @param funCodeEnum
     * @param signContract
     * @return
     * @throws Exception
     */
    public SignQueryResult doBusiness(FunCodeEnum funCodeEnum, SignContract signContract) throws Exception {
        log.info("签约查询开始:{}，{}", funCodeEnum, signContract);
        ResponseMessage responseMessage = applyYouFuByHttpPost(funCodeEnum, signContract);
        SignQueryResult signQueryResult = JSON.parseObject(responseMessage.getResData(), SignQueryResult.class);
        log.info("签约查询结束:{}", signQueryResult);
        return signQueryResult;
    }
}
